<ion-header>
  <ion-navbar>
    <ion-title>创建任务</ion-title>
  </ion-navbar>
</ion-header>

<ion-content>
  <ion-list>
    <ion-item>
      <ion-label>标题</ion-label>
      <ion-input type="text" [(ngModel)]="form_content.title"></ion-input>
    </ion-item>

    <ion-item>
      <ion-label>类型</ion-label>
      <ion-select [(ngModel)]="form_content.type" okText="确定" cancelText="取消">
        <ion-option value="{{item.name}}" *ngFor="let item of alltype">{{item.name}}</ion-option>
      </ion-select>
    </ion-item>

    <ion-item>
      <ion-label>等级</ion-label>
      <ion-select [(ngModel)]="form_content.level" okText="确定" cancelText="取消">
        <ion-option value="{{item.title}}" *ngFor="let item of allgrade">{{item.title}}</ion-option>
      </ion-select>
    </ion-item>

    <ion-item>
      <ion-label>所属项目</ion-label>
      <ion-select [(ngModel)]="form_content.tasktype" okText="确定" cancelText="取消">
        <ion-option value="{{item.project}}" *ngFor="let item of projecttype">{{item.project}}</ion-option>
      </ion-select>
    </ion-item>

    <ion-item>
      <ion-label>接收人</ion-label>
      <ion-select [(ngModel)]="form_content.receiveuserid" okText="确定" cancelText="取消">
        <ion-option value="{{item.id}}" *ngFor="let item of receiveuser" selected="true">{{item.name}}</ion-option>
      </ion-select>
    </ion-item>

    <ion-item class="detail_box">
      <span>内容</span>
      <div id="editor"
           contenteditable="true"
           (mouseup)="saveSelection();"
           (keyup)="saveSelection();"
           (focus)="restoreSelection();"
           placeholder="轻触屏幕开始编辑正文" [innerHTML]="form_content.content"></div>
      <i class="addfile" (tap)="clickUploadImgBtn()" style="float:right;font-style:normal;display:inline-block;padding:6px 10px;color: #fff;background: #65b6d3;margin-top: 8px;"><ion-icon name="add" style="margin-right:6px;"></ion-icon>插入图片</i>
    </ion-item>
  </ion-list>
</ion-content>

<ion-footer>
  <ion-toolbar color="hscs" style="border:0;">
    <ion-title *ngIf="!flag" (tap)="submitit()">提交</ion-title>
    <ion-title *ngIf="flag" (tap)="gomodifyTask()">确定修改</ion-title>
  </ion-toolbar>
</ion-footer>
